<?php
if (!empty($users))
{
	foreach($users as $user)
		{ ?>
		<tr>
		<td><?php echo $user['name']; ?></td>
		<td><?php echo $user['prefix']; ?></td>
		<td><?php echo $user['suffix']; ?></td>
		<td><?php echo $user['group']; ?></td>
		<?php
		/*if (!empty($user['subgroups']))
		{
			foreach($user['subgroups'] as $subgroup)
			{
				echo $subgroup."<br/>";
			}
		}*/
		?>
		<td>
		<?php
		if (!empty($user['permissions']))
		{
			foreach($user['permissions'] as $permission)
			{
				echo $permission."<br/>";
			}
		}
		?>
		</td>
	<?php echo "<td><a class='ui-icon ui-icon-pencil' title='Edit' href='#' onclick='editpermuser(".json_encode(array($user['name'],$user['prefix'],$user['suffix'],$user['group'],$user['permissions'])).");'></a></td>";
	echo "<td>".$js->link('Del',array('controller'=>'plugins','action'=>'delpermuser'),array('htmlAttributes'=>array('title'=>'Delete','class'=>'ui-icon ui-icon-trash'),'update'=>'#plugins_showpermusers','confirm'=>'Are you sure ?','data'=>'{world:$(\'#worldlist\').val(),user:\''.$user['name'].'\'}','method'=>'post','dataExpression'=>true))."</td>";
		?>
		</tr>
		<?php
	}
	echo $this->Js->writeBuffer();	
}
?>